<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }} ==== {{ visibleFlag }}</div>
    <input type="button" value="按钮" @click="showHandler">
    <!-- <dia :visible="visibleFlag" @canle="visibleFlag=false" /> -->
    <!-- sync 修饰符语法 -->
    <dia :visible.sync="visibleFlag" />

  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import dia from './dia.vue'
export default {
  name: 'Dashboard',
  components: { dia },
  data() {
    return {
      visibleFlag: false
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  methods: {
    showHandler() {
      this.visibleFlag = !this.visibleFlag
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
